import requests


# 旧版请求地址（不需要登录，但容易限流）
# url = 'https://www.gsxt.gov.cn/affiche-query-area-info-paperall.html?noticeType=21&areaid=100000&noticeTitle=&regOrg='

# 新版请求地址（需要登录）
url = 'https://shiming.gsxt.gov.cn/affiche-query-area-info-paperall.html?noticeType=21&areaid=100000&noticeTitle=&regOrg=110000'

data = {
    # 'draw': '0',  # draw：代表点击分页页号次数
    'start': '0',
    'length': '10'
}

# 准备请求头
headers = {
    'User-Agent': 'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/122.0.6261.95 Safari/537.36',

    # 'User-Agent': 'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/126.0.0.0 Safari/537.36',

    # 'Referer': 'https://shiming.gsxt.gov.cn/corp-query-entprise-info-xxgg-100000.html',

    # 新版Cookie
    'Cookie': '__jsluid_s=6a276577cceb2b67ca381dfadd9fbf9b; __jsl_clearance_s=1741506345.686|0|pTn%2BJgKgrGeNTB7Tr6FTCKvZqhQ%3D; JSESSIONID=9de02e234a3d53bac028d65d7981; SECTOKEN=6806004367823209857'

    # 老版Cookie
    # 'Cookie': '__jsluid_h=e455cbdc36791de05566dd957fbb5a0c; __jsl_clearance=1741509265.849|0|FLWqEhltt13ZeWEmH%2BiaxI5OLSg%3D; __jsluid_s=e7aa333ad1d096378b030693c856c735; __jsl_clearance_s=1741509267.607|0|FFVwSO7lJhAeVgGR4FJiWUu50u8%3D; HttpOnly; JSESSIONID=a0aaf6f84ee07fe1e6f769bbf405; tlb_cookie=S13.8.2.184'
}

# proxies = {
#     'http': 'http://110.52.235.85:9999'
# }

response = requests.post(url, data=data, headers=headers)
print('状态码', response.status_code)
print('响应内容', response.content.decode())
